<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>修改密码</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="views/static/layui-v2.5.6/layui/css/layui.css"  media="all">
</head>
<body id="bd" background="views/static/imgs/bg0.png" style="background-repeat: no-repeat;background-size: 100% 100%;background-attachment: fixed;">
              
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend><span style="color: white;font-family: 宋体;font-weight: bold;">修改密码</span></legend>
</fieldset>

<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
  <button data-method="notice" class="layui-btn layui-btn-radius" style="position: relative;left: 30px;"><i class="layui-icon"></i>返回</button>
</div>

<div style="position:absolute;left: 450px;top:50px;background-color: rgba(255, 255, 255, 0.6);width:400px;">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<form class="layui-form" action="controller/updatePassword.action" lay-filter="example" onsubmit="return eg.regCheck();" method="post">

   <div class="layui-form-item">
    <label class="layui-form-label">当前用户</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="text" name="uname" id="uname" lay-verify="title" value="<%=session.getAttribute("uname") %>" autocomplete="off" class="layui-input">
    </div>
  </div>
	
  <div class="layui-form-item">
    <label class="layui-form-label">当前密码</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="password" name="past_upwd" id="past_upwd" lay-verify="title" autocomplete="off"  placeholder="Current Password" class="layui-input">
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">新密码</label>
    <div class="layui-input-block" style="width: 230px;">
      <input type="password" name="upwd" id="upwd" lay-verify="title" autocomplete="off" class="layui-input" placeholder="New Password">
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">确认新密码</label>
    <div class="layui-input-block" style="width: 230px;">
      	<input type="password" name="confirm_new_upwd" id="user_confirm_password" lay-verify="title" autocomplete="off" class="layui-input" placeholder="Confirm New Password" >
    </div>
  </div>
  
  <div class="layui-form-item">
    <div class="layui-input-block" >
      <button type="submit" class="layui-btn layui-btn-radius" lay-submit="" lay-filter="" style="position: absolute;">确认修改</button>
      <button type="reset" class="layui-btn layui-btn-radius" lay-submit="" lay-filter="" style="position: relative;left:100px;">重新填写</button>
    </div>
  </div>
  
</form>
</div>
<script src="views/static/layui-v2.5.6/layui/layui.js" charset="utf-8"></script>
<script src="views/static/layui-v2.5.6/layui/layui.all.js" charset="utf-8"></script>

<script>
		var eg = {};
		eg.$ = function(id){
			return document.getElementById(id);
		};
	
		eg.regCheck = function(){
			var upwd = eg.$("past_upwd");
			var upwd1 = eg.$("user_confirm_password");
			var upwd2 = eg.$("upwd");
	
			if(upwd2.value==upwd.value){
				alert('新密码不可以旧密码一样！！！请重新输入！');
				return false;
			}
			if(upwd2.value != upwd1.value){
				alert('密码不一致！！！请重新输入！');
				return false;
			}
			
			

		return true;
			};
	</script>
	
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  
  
  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });
 
  
});
</script>
<script>
layui.use('layer', function(){ //独立版的layer无需执行这一句
  var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
  
  //触发事件
  var active = {
    notice: function(){
      //示范一个公告层
      layer.open({
        type: 1
        ,title: false //不显示标题栏
        ,closeBtn: false
        ,area: '300px;'
        ,shade: 0.5
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btn: ['确定', '取消']
        ,btnAlign: 'c'
        ,moveType: 1 //拖拽模式，0或者1
        ,content: '<div style="padding: 50px; line-height: 22px; background-color: white; color:black; font-weight: 400;font-size:18px;">您的数据将会丢失哦！</div>'
        ,success: function(layero){
          var btn = layero.find('.layui-layer-btn');
          btn.find('.layui-layer-btn0').attr({
            href: 'views/static/background.html'
            
          });
        }
      });
    }
  };
  
  
});
</script>

</body>
</html>